package com.haiertvbic.tvnow.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.util.AttributeSet;
import android.widget.ImageView;

public class MyImageView extends ImageView {
	private PaintFlagsDrawFilter pfdf;

	public MyImageView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		pfdf = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG
				| Paint.FILTER_BITMAP_FLAG);
	}

	public MyImageView(Context context, AttributeSet attrs) {
		super(context, attrs);
		pfdf = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG
				| Paint.FILTER_BITMAP_FLAG);
	}

	public MyImageView(Context context) {
		super(context);
		pfdf = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG
				| Paint.FILTER_BITMAP_FLAG);
	}

	@Override
	public void draw(Canvas canvas) {
		canvas.setDrawFilter(pfdf);
		super.draw(canvas);
	}

	@Override
	protected void dispatchDraw(Canvas canvas) {
		canvas.setDrawFilter(pfdf);
		super.dispatchDraw(canvas);
	}
}
